﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace SAKS.IServices
{
    public static class AccountValidation
    {
        public static string ErrorCodeToString(MembershipCreateStatus createStatus)
        {
            // See http://go.microsoft.com/fwlink/?LinkID=177550 for
            // a full list of status codes.
            switch (createStatus)
            {
                case MembershipCreateStatus.DuplicateUserName:
                    return "用户名已经存在，请重试其他名字.";

                case MembershipCreateStatus.DuplicateEmail:
                    return "该email地址被使用，请重试其他email.";

                case MembershipCreateStatus.InvalidPassword:
                    return "密码输入有误";

                case MembershipCreateStatus.InvalidEmail:
                    return "邮箱输入有误.";

                case MembershipCreateStatus.InvalidAnswer:
                    return "密码找回问题答案有误.";

                case MembershipCreateStatus.InvalidQuestion:
                    return "密码找回问题有误";

                case MembershipCreateStatus.InvalidUserName:
                    return "用户名不正确";

                case MembershipCreateStatus.ProviderError:
                    return "权限验证提供程序返回了一个错误，请验证您的输入并重试. 如果问题仍然存在，请与管理员联系";

                case MembershipCreateStatus.UserRejected:
                    return "用户创建请求已经取消. 请验证你的输入并重试. 如果问题仍然存在，请与管理员联系.";

                default:
                    return "出现未知错误.请验证你的输入并重试. 如果问题仍然存在，请与管理员联系.";
            }
        }
    }
}
